//获取应用实例
const app = getApp()
var api = require('../../utils/api.js')
var util = require('../../utils/util.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    interaction_hidden: true,
    popupCol:true
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    this.setData({
      windowHeight: app.globalData.windowHeight
    })
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {
    // console.log(app.globalData);
    this.setData({
      userData: app.globalData.accountInfo,
      user_flag: app.globalData.accountInfo.user_flag
    })
  },
  myOrder: function(e) {
    var types = e.currentTarget.dataset.types;
    wx.navigateTo({
      url: '/center/pages/myOrder/myOrder?types=' + types
    })
  },
  giftCard: function() {
    wx.navigateTo({
      url: '/play/pages/myGift/myGift'
    })
  },
  pickupRecord: function () {
    wx.navigateTo({
      url: '/center/pages/pickupRecord/pickupRecord'
    })
  },
  coupons: function() {
    wx.navigateTo({
      url: '/center/pages/coupons/coupons'
    })
  },
  myIncome: function() {
    wx.navigateTo({
      url: '/center/pages/myIncome/myIncome'
    })
  },

  contact: function() {
    wx.makePhoneCall({
      phoneNumber: '4000788519'
    })
  },

  bindPhone: function() {
    wx.navigateTo({
      url: '/center/pages/phoneBind/phoneBind'
    })
  },

  interaction: function() {
    this.setData({
      interaction_hidden: !this.data.interaction_hidden
    })
  },
  talk: function() {
    wx.navigateTo({
      url: '/center/pages/writing/writing',
    })
  },
  popupSel: function () {
    this.setData({
      popupCol: !this.data.popupCol
    })
  }

})